package org.boot.ssm.wxshop.service;

import com.github.pagehelper.PageInfo;
import org.apache.ibatis.annotations.Param;
import org.boot.ssm.wxshop.common.BaseService;
import org.boot.ssm.wxshop.domain.CarouselImg;
import org.boot.ssm.wxshop.domain.Comment;
import org.boot.ssm.wxshop.domain.OrderInfo;
import org.boot.ssm.wxshop.domain.User;
import org.boot.ssm.wxshop.web.common.JsonResult;
import org.springframework.stereotype.Service;

import java.util.List;


public interface OrderInfoService extends BaseService<OrderInfo> {
    /*****************************
    * @Description: 条件查询分解显示接口
    * @Param:  
    * @return:  
    * @Author: 刘涛 
    * @Date: 2018/3/16 
    *******************************/
    public PageInfo<OrderInfo> selectOrderInfoForPage(Integer pageNum,Integer pageSize,OrderInfo orderInfo,String firstTime,String lastTime);

    /*****************************
    * @Description: 更改订单状态
    * @Param:  
    * @return:  
    * @Author: 刘涛 
    * @Date: 2018/3/16 
    *******************************/
    public JsonResult updateState(OrderInfo orderInfo);

    /*****************************
    * @Description: 批量发货 
    * @Param:  
    * @return:  
    * @Author: 刘涛 
    * @Date: 2018/3/16 
    *******************************/
    public JsonResult updateStateMore(List<OrderInfo> list);


    /**
     * 根据用户查询所有订单及详情
     * @param id
     * @return
     */
    public JsonResult selectOrderInfoAndDetil(Integer id,Integer state);


    /**
     * 根据状态以及用户ID查询订单记录条数
     * @param orderInfo
     * @param userId
     * @return
     */
    public JsonResult countState(OrderInfo orderInfo,Integer userId);


    /**
     * 根据订单号及用户ID查询单个订单
     * @param id
     * @param userId
     * @return
     */
    public OrderInfo selectOneOrder(@Param("id")String id, @Param("userId")Integer userId);


    /**
     * 逻辑删除订单
     * @param orderInfo
     * @return
     */
    public JsonResult deleteOrder(OrderInfo orderInfo);


    /**
     * 添加单个商品订单
     * @param goodsId
     * @param specifications
     * @return
     */
    public JsonResult addOrderForOneGoods(Integer goodsId,String specifications,Integer userId);


    /**
     * 添加多个商品的订单
     * @param carId
     * @param userId
     * @return
     */
    public JsonResult addOrderForMoreGoods(Integer[] carIds,Integer userId);





}
